package servlets;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import models.SelectQuest;

/**
 * Servlet implementation class Choix1
 */
@WebServlet(name="Choix1", urlPatterns={"/JSP/Maha/Choix1"})
public class Choix1 extends HttpServlet {
	private static final long serialVersionUID = 1L;

   

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	 //@SuppressWarnings("null")
	 protected void doPost( HttpServletRequest request, HttpServletResponse response) 
			 throws IOException, ServletException {

		 
		 
String titre=request.getParameter("titre");		 
String nbrQL= request.getParameter("nbrQL");
String nbrQM= request.getParameter("nbrQM");
String nbrQU= request.getParameter("nbrQU");


// Now use our Coffee Model above 
SelectQuest ce = new SelectQuest();

ce.getTitle(titre);
ce.getQL(nbrQL);
ce.getQM(nbrQM);
ce.getQU(nbrQU);
request.setAttribute("titre", titre);
request.setAttribute("nbrQL", nbrQL);
request.setAttribute("nbrQM", nbrQM);
request.setAttribute("nbrQU", nbrQU);
RequestDispatcher view = request.getRequestDispatcher("result.jsp");

view.forward(request, response); 

}

}
